Skip to content

Start Year Control#587

Merged
aaron-kaplan merged 3 commits intomasterfrom
control_years
Jan 22, 2026
Merged

Start Year Control#587
aaron-kaplan merged 3 commits intomasterfrom
control_years

Conversation

@nitinmagima
Copy link
Contributor

Added a Start Year control to the FBF maproom so we can set the earliest year for the table, and updated the export API and callback validation to support it and avoid errors when controls are unset.

Changes

  1. Start Year Control (UI + logic)
  • UI (fbflayout.py): New “Start year” dropdown.
  • Logic (fbfmaproom.py):
    • start_year_selector callback: options from season_conf["start_year"], optional start_year from query.
    • table_cb and generate_tables → fundamental_table_data use the selected start year to filter the year range.
    • start_year in the URL/query for bookmarking and sharing.
  1. Export API
    Optional start_year query parameter (int): earliest year for exported skill, history, and threshold. If omitted, defaults to the season’s start_year from config.

- forecast_selectors: raise ValueError if season or col_name is None
- tile_url_callback: also check issue_month_abbrev before PreventUpdate
@nitinmagima nitinmagima self-assigned this Jan 20, 2026
Copilot AI review requested due to automatic review settings January 20, 2026 21:11
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds a Start Year control to the FBF maproom that allows users to set the earliest year for table data display. The changes include UI components, callback logic, and API support for the new functionality.

Changes:

  • Added a new "Start year" dropdown control to the table layout that filters table data to show only years from the selected start year onwards
  • Updated the export API to accept an optional start_year query parameter with proper defaulting to season configuration
  • Added validation checks to prevent errors when controls are unset (None checks in forecast_selectors and tile_url_callback)

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
fbfmaproom/fbflayout.py Added new Start Year dropdown control to the table controls section
fbfmaproom/fbfmaproom.py Added start_year_selector callback, updated table_cb and generate_tables to use start_year parameter, added None validation to existing callbacks, and updated export_endpoint to support optional start_year parameter

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@aaron-kaplan aaron-kaplan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good except that you haven't added start_year to the query string, so the value won't be saved in the URL for bookmarking and sharing the way the other controls are. For writing the value to the query string, see where it says APP.clientside_callback (JavaScript in a Python string, yuck), and for reading from the querystring into the application, see any place where State("location", "search") is used.

Other than that, my comments below are mostly for my edification, not necessarily saying what you did was wrong. It's just that I see changes in several places that seem unrelated to the start_year functionality, so I'd like to know what problems you're fixing there.

@nitinmagima
Copy link
Contributor Author

nitinmagima commented Jan 20, 2026 via email

@nitinmagima
Copy link
Contributor Author

nitinmagima commented Jan 20, 2026

@aaron-kaplan
Copy link
Collaborator

It shows up in the URL, so I think it works!

What you need to test is not only that it shows up in the URL, but that when you reload that URL, or bookmark it and then come back to it in a new window, the setting is applied. I checked, and it is, so good job!

Set up a test server and share it with the group. If there are no comments from the others, I will merge.

@aaron-kaplan aaron-kaplan merged commit 21af8b4 into master Jan 22, 2026
1 check passed
@aaron-kaplan aaron-kaplan deleted the control_years branch January 22, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments